package com.wxy.demo.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.experimental.Accessors;

import java.beans.Transient;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/5/19 16:37
 */
@Data
@Accessors(chain = true)
public class UserDto {
    private String name;
    private String address;
    private String parentName;
    private Date birth;
    private Double weight;

    /**
     * 循环引用
     */
    @JsonIgnore
    private UserDto dto;

    @Transient
    public Double getHeight() {
        return height;
    }

    private Double height;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
